<?php


namespace App\Models\Field;

class ReplyField extends BaseField
{
    // 笔记
    public const NOTE = 'note';

    // 消息静态化
    public const MESSAGE_STATIC = 'messageStatic';

    public static function getFormats($scene = self::BASE_INFO): array
    {
        $baseFormats = [
            'id' => static function ($model) {
                return $model['reply_id'];
            },
            'user_id',
            'to_user_id',
            'comment_id',
            'content',
            'type',
            'is_deleted',
            'created_at',
        ];
        $formats = [
            self::NOTE => $baseFormats,
            self::MESSAGE_STATIC => [
                'id' => static function ($model) {
                    return $model['reply_id'];
                },
                'content',
            ],

            self::BASE_INFO => $baseFormats,
            self::SELF_LIST => $baseFormats,
            self::SELF_DETAIL => $baseFormats,
        ];

        return $formats[$scene] ?? $baseFormats;
    }
}
